package com.woniu.new_orange.customization_model_zhang.controller;

import com.woniu.new_orange.customization_model_zhang.dto.AirTicketDto;
import com.woniu.new_orange.customization_model_zhang.service.AirTicketService;
import com.woniu.new_orange.customization_model_zhang.vo.AirTicketVo;
import com.woniu.new_orange.entity.AirTicket;
import com.woniu.new_orange.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Program: new_orange->CustomizationController
 * @Description: 定制服务表控制层
 * @Author: donghang
 * @Date: 2023-01-14 09:46
 * @Version： 1.0
 **/
@RestController
@RequestMapping("/airticket")
public class AirTicketController {
    @Resource
    private AirTicketService airTicketService;

    @PostMapping("/submitFormAirDo")
    public Result add(@RequestBody AirTicket dynamicValidate){
        int insert = airTicketService.insertSelective(dynamicValidate);
        return Result.ok();
    }
//  张煜杰  2023/2/10 16:14

    //  张煜杰  2023/2/10 16:14//  张煜杰  2023/2/10 16:14//  张煜杰  2023/2/10 16:14
    @GetMapping("{airTicketBy1}")
    public Result loadAir(@PathVariable String airTicketBy1){
        int i = Integer.parseInt(airTicketBy1);
        List<AirTicketVo> airVos = airTicketService.selectAll(i);
        return Result.ok().data("AirData",airVos);
    }
    @DeleteMapping("{airTicketId}")
    public Result delete(@PathVariable long airTicketId){
        int i = airTicketService.deleteByPrimaryKey(airTicketId);
        return Result.ok();
    }
}
